﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 会员卡管理系统
{
    
    public partial class NorStayfrm : Form
    {
        public NorStayfrm()
        {
            InitializeComponent();
        }
        Vipclass.tbVipHouseMenthod normenthod = new Vipclass.tbVipHouseMenthod();
        Vipclass.tb_viphouseinfo norinfo = new Vipclass.tb_viphouseinfo();
        private void btnOk_Click(object sender, EventArgs e)
        {
            norinfo.Bolhousestay = 1;
            if (tbxname.Text == "" || textBox2.Text == "")
            {
                MessageBox.Show("输入为空，请重新输入！", "提示");
                return;
            }
            norinfo.Strvipname = tbxname.Text;
            norinfo.Strvipidcard = "(临)"+textBox2.Text;
            norinfo.Strhouseid = cbxhouseid.Text.Trim();
            if(normenthod.tbhousefoNoruse(norinfo)==1)
            {
                MessageBox.Show("入住成功！", "提示");
                this.Close();
            }
            else
            {
                MessageBox.Show("入住失败！", "错误");
                this.Close();
            }
        }

        private void NorStayfrm_Load(object sender, EventArgs e)
        {
            normenthod.tbNorusefoFill(cbxhouseid);
        }

        private void btnNo_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
